1. Field of the Invention
The present invention relates to data processing systems and, more particularly, to sharing library resources within a client device having multiple applications running within a Java virtual machine.
2. Description of the Related Art
In an environment such as a set top box (STB), memory and computational resources are typically constrained. This leads to a limit on the size of programs that can be executed. To reduce the memory necessary to support execution of a program, dynamically loadable and sharable class libraries have been implemented in operating systems such as Unix and Windows, as well as execution environments such as Java.
A shared library allows applications to share common code between the applications. A request for a program file (such as a class definition) is received by a class loader from an executing process (such as an application or applet within a Java Virtual Machine) external to a shared library. In response to receiving the request, the class loader loads the appropriate program file from the shared library. Since each of the applications is operating within a common context, each application may call methods from the common or shared library. Unfortunately, where applications are run in multiple or respective contexts, this direct calling of methods related to other applications does not work. In this case, the shared library must be compiled in its entirety for each application.